package br.com.automed.converter;

import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
import javax.faces.convert.Converter;
import javax.faces.convert.FacesConverter;

import br.com.automed.entity.AreaMedica;
import br.com.automed.jpautil.JPAUtil;

@FacesConverter(forClass=AreaMedica.class)
public class AreaMedicaConverter implements Converter {

	public Object getAsObject(FacesContext context, UIComponent component, String value) {
		
		return JPAUtil.get(AreaMedica.class, value);
	}

	public String getAsString(FacesContext context, UIComponent component, Object value) {
		// TODO Auto-generated method stub
		return value.toString();
	}

}
